import request from '@/config/axios'

// 展讯 VO
export interface ExhibitionInfoVO {
  userId: number // 发布人ID
  id: number // ID
  startDate: Date // 开始时间
  endDate: Date // 结束时间
  venueAddress: string // 详细地址
  description: string // 详细介绍
  title: string // 标题
  cover: string // 宣传图片
  schoolId: number // 举办单位
  titleEn: string // 英文标题
  regionId: number // 地区编号
}

// 展讯 API
export const ExhibitionInfoApi = {
  // 查询展讯分页
  getExhibitionInfoPage: async (params: any) => {
    return await request.get({ url: `/td/exhibition-info/page`, params })
  },

  // 查询展讯详情
  getExhibitionInfo: async (id: number) => {
    return await request.get({ url: `/td/exhibition-info/get?id=` + id })
  },

  // 新增展讯
  createExhibitionInfo: async (data: ExhibitionInfoVO) => {
    return await request.post({ url: `/td/exhibition-info/create`, data })
  },

  // 修改展讯
  updateExhibitionInfo: async (data: ExhibitionInfoVO) => {
    return await request.put({ url: `/td/exhibition-info/update`, data })
  },

  // 删除展讯
  deleteExhibitionInfo: async (id: number) => {
    return await request.delete({ url: `/td/exhibition-info/delete?id=` + id })
  },

  // 导出展讯 Excel
  exportExhibitionInfo: async (params) => {
    return await request.download({ url: `/td/exhibition-info/export-excel`, params })
  },
}
